package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class SortInteger {
    public static void main(String[] args) {
        Random ran = new Random();
        List<Integer> arr = new ArrayList<>();
        for (int i=0;i<10;i++){
            arr.add(ran.nextInt(100));
        }

        System.out.println("arr中的元素有:"+ arr);

        Collections.sort(arr);

        System.out.println("arr排序后:"+ arr);

        Collections.reverse(arr);
        System.out.println("arr倒序后:"+ arr);

        System.out.println("arr中第一个元素是:"+arr.get(0));
    }
}
